//
//  PhotosViewController.m
//  LimitFree
//
//  Created by LZXuan on 15-4-15.
//  Copyright (c) 2015年 LZXuan. All rights reserved.
//

#import "PhotosViewController.h"
#import "UIImageView+WebCache.h"
@interface PhotosViewController ()<UIScrollViewDelegate>
{
    UIScrollView *sView;
    NSInteger _singleIndex;
}


@end

@implementation PhotosViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor lightGrayColor];
    [self creatScrollView];
}

- (void)creatScrollView{

    sView =[[UIScrollView alloc] initWithFrame:CGRectMake(10, 0, [LZXHelper getScreenSize].width-20, [LZXHelper getScreenSize].height-64-49)];
    for (int i = 0; i < self.photosArr.count; i++) {
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(sView.bounds.size.width*i, 0, sView.bounds.size.width , sView.bounds.size.height)];
        NSString *bigPic = [self.photosArr[i] objectForKey:@"originalUrl"];
        [imageView sd_setImageWithURL:[NSURL URLWithString:bigPic]];
        [sView addSubview:imageView];
        
    }
    sView.pagingEnabled = YES;
    sView.contentOffset = CGPointMake(self.curIndex*sView.bounds.size.width, 0);
    sView.contentSize = CGSizeMake(self.photosArr.count * sView.bounds.size.width, [LZXHelper getScreenSize].height-64-49);
    [self.view addSubview:sView];
}




@end
